import requests
from bs4 import BeautifulSoup


url = 'https://www.huya.com/l'

resonpese = requests.get(url)

soup = BeautifulSoup(resonpese.text, 'lxml')

# data = soup.select('#js-live-list > li:nth-child(1) > a.title.new-clickstat')
data1 = soup.select('#js-live-list > li > a.title.new-clickstat')
for item in data1:
    result = {
        '主播名': item.get_text(),
    }
    print(result)
data2 = soup.select('#js-live-list > li > span > span.game-type.fr > a')

for item2 in data2:
    r = {
        '直播类型': item2.get('title')
    }
    print(r)



